import { ParamsRule } from '@/types/global';
import request, { Method } from '@/utils/axios';
// 添加店员申请
export function addStaffApplication(params: { name: string; phone: string }) {
  return request({
    url: '/assistant',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params,
  });
}

// 更新店员申请信息
export function updateStaffApplication(params: { id: string; name: string; phone: string }) {
  return request({
    url: '/assistant',
    method: Method.PUT,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params,
  });
}

// 获取店员列表
export function getStaffList(params?: ParamsRule) {
  return request({
    url: '/assistant/list',
    method: Method.GET,
    needToken: true,
    params,
  });
}

export function getAssistantMenu(assistantId: string | number) {
  return request({
    url: `/assistant/getAssistantMenu/${assistantId}`,
    method: Method.GET,
    needToken: true
  });
}

export function updateAssistantMenu(assistantId: string | number, params: any) {
  return request({
    url: `/assistant/updateAssistantMenu/${assistantId}`,
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params,
  });
}